﻿using OpenTK.Windowing.GraphicsLibraryFramework;

namespace OpenGl.Explore.FirstApp
{
    public unsafe class OpenglWindow
    {
        private readonly Window* _window;

        private readonly int _width;

        private readonly int _height;

        public Window* Window => _window;

        public int Width => _width;

        public int Height => _height;

        public OpenglWindow(int width, int height)
        {
            _width = width;
            _height = height;
            _window = GLFW.CreateWindow(width, height, "第一个OpenGl程序", null, null);
            if(_window == null)
            {
                GLFW.Terminate();
                throw new Exception("Window create failed");
            }
        }
    }
}
